package com.by.bean;

import com.by.common.group.ISave;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author Ye QS
 * @version 0.1
 * @className Sales
 * @description
 * @date 2024/9/16 21:31
 * @since jdk11
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("联系人信息")
public class Contacts implements Serializable {
    @ApiModelProperty(value = "联系人id", hidden = true, required = false)
    private Integer id;

    @ApiModelProperty(value = "销售联系人", required = true)
    @NotEmpty(message = "销售联系人不能为空")
    private String salesContact;

    @ApiModelProperty(value = "销售联系电话", required = true)
    @NotEmpty(message = "销售联系电话不能为空")
    private String salesPhone;

    @ApiModelProperty(value = "销售邮箱", required = true)
    @NotEmpty(message = "销售邮箱不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$",
            message = "销售邮箱格式不正确", groups = {ISave.class})
    private String salesEmail;

    @ApiModelProperty(value = "老板联系人", required = true)
    @NotEmpty(message = "老板联系人不能为空")
    private String bossContact;

    @ApiModelProperty(value = "老板联系电话", required = true)
    @NotEmpty(message = "老板联系电话不能为空")
    private String bossPhone;

    @ApiModelProperty(value = "老板邮箱", required = true)
    @NotEmpty(message = "老板邮箱不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$",
            message = "老板邮箱格式不正确", groups = {ISave.class})
    private String bossEmail;

    @ApiModelProperty(value = "财务联系人", required = true)
    @NotEmpty(message = "财务联系人不能为空")
    private String financeContact;

    @ApiModelProperty(value = "财务联系电话", required = true)
    @NotEmpty(message = "财务联系电话不能为空")
    private String financePhone;

    @ApiModelProperty(value = "财务邮箱", required = true)
    @NotEmpty(message = "财务邮箱不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$",
            message = "财务邮箱格式不正确", groups = {ISave.class})
    private String financeEmail;
}
